/*
 *  Copyright (C) 2010 MADSA.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see http://www.gnu.org/licenses/. 
 *
 *  Author: Jorge Pintado de Santiago
 *          Victor Mayoral Vilches
 *          
 */

package com.madsa.tuPeli;

import com.madsa.tuPeli.cartelera.CineActivity;
import com.madsa.tuPeli.cartelera.PeliculasActivity;
import com.sisof.R;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class Catelera extends TabActivity{

	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.cartelera);

	    Resources res = getResources();
	    TabHost tabHost =  getTabHost();
	    TabHost.TabSpec spec;
	    Intent intent;  // Reusable Intent for each tab

	    // Movies Tab
	    intent = new Intent().setClass(this, PeliculasActivity.class);
	    spec = tabHost.newTabSpec("artists").setIndicator("Peliculas",
	                      res.getDrawable(R.drawable.tabs_peliculas))
	                  .setContent(intent);
	    tabHost.addTab(spec);	    

	    // Cinemas Tab
	    intent = new Intent().setClass(this, CineActivity.class);
	    spec = tabHost.newTabSpec("albums").setIndicator("Cines",
	                      res.getDrawable(R.drawable.tabs_cines))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    tabHost.setCurrentTab(0);
	}}